package drds.binlog.parse.mysql;

import drds.binlog.common.Authors;
import drds.common.Author;

@Author(name = Authors.LI_YANG)
public enum BinlogFormat
{

    STATEMENT("STATEMENT"), ROW("ROW"), MIXED("MIXED");

    private String value;

    private BinlogFormat(String value)
    {
        this.value = value;
    }

    public static BinlogFormat valuesOf(String value)
    {
        BinlogFormat[] formats = values();
        for (BinlogFormat format : formats)
        {
            if (format.value.equalsIgnoreCase(value))
            {
                return format;
            }
        }
        return null;
    }

    public boolean isStatement()
    {
        return this == STATEMENT;
    }

    public boolean isRow()
    {
        return this == ROW;
    }

    public boolean isMixed()
    {
        return this == MIXED;
    }
}
